import 'package:projectfluttershengyihuatong/courseDetail/CourseDetailModel.dart';
import 'package:projectfluttershengyihuatong/service/jsontool.dart';
import 'package:projectfluttershengyihuatong/service/launchservice/launchservice.dart';
import 'package:projectfluttershengyihuatong/service/request_manager.dart';

class CourseDetailViewModel {
  final url = LaunchService.getInstance().config.api?.getCourseDetailById ?? "";
  Future<CourseDetailModel?> request(Map<String, dynamic> params) async {
    const url = "/api/ke/getCourseDetail";
    final response = await RequestManager.getInstance()
        .dio
        .get(url, queryParameters: params);
    try {
      final model = BaseModel<CourseDetailModel>.fromJson(response.data).data;
      dataModel = model;
      return model;
    }catch (e) {
      print(e);
      return null;
    }

  }
  CourseDetailModel? dataModel;


}
